import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
//import store from './store'
import router from './router';
import getRoutes from './grants/router';
import pinia,{useRouteStore} from "./piniaStore/index";

//vuex：做动态添加路由配置
// if(sessionStorage.getItem("grants")){
//     getRoutes();
//     store.commit({
//         type:"setIsAddRoute",
//         isAddRoute:true
//     })
// }


const app = createApp(App);
app.use(pinia);
const routeStore = useRouteStore();
// pinia：做动态添加路由配置
if(sessionStorage.getItem("grants")){
    getRoutes();
    routeStore.setIsAddRoute(true);
}
app.use(router);

app.mount('#app')


